<template>
  <el-carousel indicator-position="outside" height="160px">
    <el-carousel-item v-for="item in imgList" :key="item.id">
      <!-- <img @click="toNewsDetail(item)" :src="item.imgUrl" class="carousel-img"> -->
      <img @click="toNewsDetail(item)" class="carousel-img" :src="'data:image/jpeg;base64,' + item.imgBase64Str" alt="Base64图片" />
    </el-carousel-item>
  </el-carousel>
</template>

<script>
export default {
  props:{
    imgList:{
      type:Array,
      default:()=>[]
    }
  },
  data() {
    return {
    }
  },
  methods:{
    toNewsDetail(item) {
      this.axios({
        url: `/seeyon/oasso.do?method=redirect&loginName=${localStorage.getItem("loginName")}&url=${encodeURIComponent("/seeyon" + item.url)}`,
        method: "get",
        headers: {
          "Content-Type": "application/json",
        },
        // data: {
        //   loginName: localStorage.getItem("loginName"),
        //   url: "/seeyon" + item.url,
        // },
      }).then((res) => {
        console.log("点击新闻数据", res);
        window.open(res.data, "_blank");
      });
      
    },
  }
}
</script>

<style lang="less" scoped>
.carousel-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.el-carousel{
  border-radius: 10px;
  /deep/.el-carousel__indicators{
  position: absolute;
  bottom: 0px;
  left: 50%;
  transform: translateX(-50%);
}
}
/deep/.el-carousel .el-carousel__indicators{
  position: absolute;
  bottom: 0px;
  left: 50%;
  transform: translateX(-50%);
}


</style>